import axios from 'axios';

const instance = axios.create({
  //baseURL: process.env.VUE_APP_API_URL, // 假设你的 API 地址在这里
  baseURL:'http://localhost:8080',
  timeout: 10000,
});

instance.interceptors.response.use(
  (response) => response.data,
  (error) => {
    console.error('Error', error);
    return Promise.reject(error);
  },
);


export default {
    get(url) {
      return instance.get(url);
    },
    post(url, data) {
      return instance.post(url, data);
    }
  };
